package com.qingyunge.util;

public class NumberExtractorUtil {
    public static String get(String input) throws InterruptedException {
        StringBuilder number = new StringBuilder();
        for (char c : input.toCharArray()) {
            if (Character.isDigit(c)) {
                number.append(c);
            } else if (number.length() > 0) {
                return new String(number);
//                number.setLength(0);
            }
        }
        return null;
    }

    public static void main(String[] args){
        String s = null;
        try {
            s = get("fegqawre1223+");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("s = " + s);
    }
}